/**
 * 陈祥1.13
 */
   function changeMajors(){
    		$("#searchValue2").empty();
    		var department = $("#searchValue1").val();
    		$("#searchValue2").load("majorOptionsAction",{department:department});
   }

  	function showSelect(value){
    $("#searchValue1").remove();
    $("#searchValue2").remove();
	switch(value){
	case "process":$("#selectList").append("<select id='searchValue1' name='searchValue1'><option value=''>请选择</option><option value='1'>1.信息登记</option>" +
			"<option value='2'>2.入团考核</option><option value='3'>3.团员材料</option><option value='4'>4.正式团员</option></select>");
	      break;
	case "department":$("#selectList").append("<select id='searchValue1' name='searchValue1'></select>");
	      $("#searchValue1").load("departmentOptionsAction");
	      break;
	case "major":$("#selectList").append("<select id='searchValue1' name='searchValue1'  onchange='changeMajors()'></select>&nbsp;&nbsp;&nbsp;" +
			"<select id='searchValue2' name='searchValue2'><option value=''>请选择</option></select>");
    $("#searchValue1").load("departmentOptionsAction");
    default:return;
	}
}

 function SelectAll(a)  {
			var listc1 = document.getElementsByName("stage1");
			var listc2 = document.getElementsByName("stage2");
			var listc3 = document.getElementsByName("stage3");
			var listc4 = document.getElementsByName("stage4");
			switch(a){
				case 0:
					if(document.getElementById("CheckAll").checked==true){
		   				document.getElementById("CheckAll1").checked = true;
		   				document.getElementById("CheckAll2").checked = true;
		   				document.getElementById("CheckAll3").checked = true;
		   				document.getElementById("CheckAll4").checked = true;
		   				SelectAll(1);
		   				SelectAll(2);
		   				SelectAll(3);
		   				SelectAll(4);
		   			}
		   			else{
		    			document.getElementById("CheckAll1").checked = false;
		   				document.getElementById("CheckAll2").checked = false;
		   				document.getElementById("CheckAll3").checked = false;
		   				document.getElementById("CheckAll4").checked = false;
		   				SelectAll(1);
		   				SelectAll(2);
		   				SelectAll(3);
		   				SelectAll(4);
		   			}
		   			break;
		   		case 1:
		   			
					if(document.getElementById("CheckAll1").checked==true){
		   				for(var i=0;i<listc1.length;i++){
		     				listc1[i].checked=true;
		    			}
		   			}
		   			else{
		    			for(var i=0;i<listc1.length;i++){
		     				listc1[i].checked=false;
		    			}
		   			}
		   			break;
		   		case 2:
					if(document.getElementById("CheckAll2").checked==true){
		   				for(var i=0;i<listc2.length;i++){
		     				listc2[i].checked=true;
		    			}
		   			}
		   			else{
		    			for(var i=0;i<listc2.length;i++){
		     				listc2[i].checked=false;
		    			}
		   			}
		   			break;
		   		case 3:
					if(document.getElementById("CheckAll3").checked==true){
		   				for(var i=0;i<listc3.length;i++){
		     				listc3[i].checked=true;
		    			}
		   			}
		   			else{
		    			for(var i=0;i<listc3.length;i++){
		     				listc3[i].checked=false;
		    			}
		   			}
		   			break;
		   		case 4:
					if(document.getElementById("CheckAll4").checked==true){
		   				for(var i=0;i<listc4.length;i++){
		     				listc4[i].checked=true;
		    			}
		   			}
		   			else{
		    			for(var i=0;i<listc4.length;i++){
		     				listc4[i].checked=false;
		    			}
		   			}
		   			break;
			}
	 	 }
 
